#include "Track.h"

Track::Track() {

}
Track::Track(int id) {
	track_id = id;
}
Track::~Track() {

}
void Track::append_message(MidiMessage message) {
	this->messages.push_back(message);
	track_time += message.time;
	this->size += message.size();
	message_num++;

}
void Track::clear_message() {
	messages.clear();
	messages.resize(0);
	message_num = 0;
}
void Track::note(int flip,int time) {
	this->append_message(MidiMessage::NoteOn(flip, 0x7f, this->track_id, 0));
	this->append_message(MidiMessage::NoteOff(flip, 0x7f, this->track_id, time));
}
void Track::program_change(int program) {
	this->append_message(MidiMessage::ProgramChange(program, track_id));
}
